package cn.duxiaod.demo.enumtest;

/**
 * 枚举实现单例模式
 */
public enum EnumSingletonTest {
    INSTANCE;
    EnumSingletonTest(){
        //初始化操作
        this.age = 23;
    }
    private int age;

    public static EnumSingletonTest getInstance(){
        return INSTANCE;
    }

    public int getAge() {
        return age;
    }
}
